﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace PJ.Data
{
    [Serializable]
    [DataContract]
    public abstract class BaseOrderedFragmentData : BaseEntityFragmentData, IOrderedFragmentData
    {
        private double m_Order;

        [DataMember]
        public double Order
        {
            get { return m_Order; }
            set { m_Order = value; }
        }

        public BaseOrderedFragmentData()
        {
        }
        public BaseOrderedFragmentData(IOrderedFragmentData data) : base(data)
        {
            m_Order = data.Order;
        }
        public override IObjectData Copy(IObjectData data)
        {
            base.Copy(data);
            IOrderedFragmentData _data = data as IOrderedFragmentData;
            if (_data != null)
                this.Order = _data.Order;
            return this;
        }
        public override bool IsEqual(IObjectData obj)
        {
            if (!base.IsEqual(obj))
                return false;
            IOrderedFragmentData data = obj as IOrderedFragmentData;
            if (data != null)
                if (data.Order == this.Order)
                    return true;
            return false;
        }


    }
}
